#include <iostream>
#include <cstdio>
using namespace std;

int main(){
	int n;
	cin>>n;
	int gw=n%10;
	int sw=n/10%10;
	int bw=n/100;
	if(n==gw*gw*gw+sw*sw*sw+bw*bw*bw){
		cout<<"YES";
	}else{
		cout<<"NO";
	}
	return 0;
}
